package fyf.com.carddesign.MyUtl;

import android.content.Context;
import android.os.Environment;
import android.widget.Toast;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * 工具类
 * Created by yxz on 2017/10/25.
 */

public class MyUtl {
    public static final String PATH = "1";
    public static final String SD_HOME_DIR = Environment.getExternalStorageDirectory().getPath() + "/cartoon/";//SD卡家目录
    public static final String SD_TMP_DIR = SD_HOME_DIR + "Tmp/";//SD卡临时图片目录


    /**
     * 获取手机当前时间
     *
     * @return 当前时间格式为：yyyy年MM月dd日  HH:mm:ss
     */
    public static String getCurrentDay() {
        long time = System.currentTimeMillis();//获取到当前时间
        SimpleDateFormat df = new SimpleDateFormat("yyyy年MM月dd日  HH:mm:ss");
        return df.format(new Date(time));
    }

    public static void Toast(Context context, String tmp) {
        Toast.makeText(context, tmp, Toast.LENGTH_SHORT).show();
    }
}
